var t = require;
var e = module;
var o = exports;
var n =
    (this && this.__extends) ||
    (function () {
        var t = function (e, o) {
            return (t =
                Object.setPrototypeOf ||
                ({__proto__: []} instanceof Array &&
                    function (t, e) {
                        t.__proto__ = e;
                    }) ||
                function (t, e) {
                    for (var o in e) e.hasOwnProperty(o) && (t[o] = e[o]);
                })(e, o);
        };
        return function (e, o) {
            function n() {
                this.constructor = e;
            }
            t(e, o), (e.prototype = null === o ? Object.create(o) : ((n.prototype = o.prototype), new n()));
        };
    })();
Object.defineProperty(o, "__esModule", {value: !0});
var r = t("fsm"),
    a = t("ConfS"),
    i = t("fightManager"),
    s = t("skillboxDestory"),
    c = (function (t) {
        function e() {
            var e = (null !== t && t.apply(this, arguments)) || this;
            return (e.flyBoxs = []), e;
        }
        return (
            n(e, t),
            (e.prototype.onEnter = function () {
                (this.body = this.context.body), (this.skill = this.context.skill);
                for (var t = this.context.skill.data.Segments, e = 0; e < t.length; e++) {
                    var o = t[e] + 102e6,
                        n = a.DatasManager.FarDatasById[o],
                        r = {data: n, time: n.yanchi, index: e};
                    this.flyBoxs.push(r);
                }
            }),
            (e.prototype.onUpdate = function (t) {
                var e = this;
                this.flyBoxs.slice().forEach(function (o) {
                    if (o.time <= 0) {
                        var n = e.flyBoxs.indexOf(o);
                        e.flyBoxs.splice(n, 1), i.default.inst.flybox.add(e.body, e.skill, o.data, o.index);
                    } else o.time -= t;
                }),
                    0 == this.flyBoxs.length && r.changeState(this.context, s.default);
            }),
            e
        );
    })(t("skillboxState").default);
o.default = c;
